<!--故障维修列表 -->
<template>
    <div class="page repairList-page" data-page="repairList" style="z-index: 2;">
        <div class="link-page-nav">
            <a href="#" class="link" @click="$root.backToTab()">
                <i class="iconfont icon-zuo"></i>
            </a>
        </div>
        <div class="link-page-search">
        	<span class="tt">关联的故障维修单</span>
        </div>
        <div class="page-content">
            <ul class="repair-list" id="repair-list_{{getNewId}}">
            </ul> 
        </div>   
    </div>
</template>
<script>
    return {
        mounted() {
            var self = this;
            var app = self.$app;
            //页面传参
            self.taskId = this.$route.params.taskId;
        },
        data: function () {
            return {
                getNewId: (new Date()).getTime(),
            }
        },
        methods: {
        	getTaskMaintenanceList:function(){//获取列表数据
                var self = this;
                var $ = self.$;
                $("#repair-list_"+self.getNewId).empty();
                //增加类别选项
                Dao.getTaskMaintenanceList({
                	taskId:self.taskId,
                	name:self.selectContent,
                    userName:userInfor.accountName,
                    deviceId:appKeyObj.deviceId,
                },function(data) {
                    if(data && data.length>0){
                        for(var i=0;i<data.length;i++){
                            $("#repair-list_"+self.getNewId).append(`
                            		<li>
                					<a href="/finishMsg/`+data[i].id+`/">
                						<p class="workType"><i class="iconfont icon-weixiuon" style="color: #4889D3;"></i>故障维修</p>
                						<p class="content">`+data[i].hiddenDangerDesc+`</p>
                						<p class=""><i class="iconfont icon-dingweiweizhi" style="color:#2471CA;margin-right: 6px;"></i>`+data[i].orgName+`</p>
                					</a>
           							<div class="pic-panels" id="list-swiper`+data[i].id+`_`+self.getNewId+`">
           							</div>
                				</li>
                            `);
                          //展示图片
                           showImage(jQuery("#list-swiper"+data[i].id+`_`+self.getNewId),data[i].picUrls);
                        }
                    }else{
                        $("#repair-list_"+self.getNewId).append(`<div class="no-data-img"><img src="`+listNoDataPic()+`"/></div>`);
                    }
                });
            },
            backToTab: function() {
                app.methods.backToTab();
            },
        },
        on: {
            pageInit: function (e, page) {
                var self = this;
                var $ = self.$;
                self.getTaskMaintenanceList();
            },
            pageBeforeIn:function(e,page) {
            },
            pageAfterIn: function(e, page) {
               var self = this;
               var $ = self.$;
               
            },
            pageBeforeRemove: function(e, page) {
               
            }
        }
    }
</script>